package com.ruoyi.project.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.mapper.SysAccountsMapper;
import com.ruoyi.project.system.domain.SysAccounts;
import com.ruoyi.project.system.service.ISysAccountsService;

/**
 * 部门金额明细Service业务层处理
 * 
 * @author jjp
 * @date 2020-04-26
 */
@Service
public class SysAccountsServiceImpl implements ISysAccountsService 
{
    @Autowired
    private SysAccountsMapper sysAccountsMapper;

    /**
     * 查询部门金额明细
     * 
     * @param accountsId 部门金额明细ID
     * @return 部门金额明细
     */
    @Override
    public SysAccounts selectSysAccountsById(Long accountsId)
    {
        return sysAccountsMapper.selectSysAccountsById(accountsId);
    }

    /**
     * 查询部门金额明细列表
     * 
     * @param sysAccounts 部门金额明细
     * @return 部门金额明细
     */
    @Override
    public List<SysAccounts> selectSysAccountsList(SysAccounts sysAccounts)
    {
        return sysAccountsMapper.selectSysAccountsList(sysAccounts);
    }

    /**
     * 新增部门金额明细
     * 
     * @param sysAccounts 部门金额明细
     * @return 结果
     */
    @Override
    public int insertSysAccounts(SysAccounts sysAccounts)
    {
        sysAccounts.setCreateTime(DateUtils.getNowDate());
        return sysAccountsMapper.insertSysAccounts(sysAccounts);
    }

    /**
     * 修改部门金额明细
     * 
     * @param sysAccounts 部门金额明细
     * @return 结果
     */
    @Override
    public int updateSysAccounts(SysAccounts sysAccounts)
    {
        return sysAccountsMapper.updateSysAccounts(sysAccounts);
    }

    /**
     * 批量删除部门金额明细
     * 
     * @param accountsIds 需要删除的部门金额明细ID
     * @return 结果
     */
    @Override
    public int deleteSysAccountsByIds(Long[] accountsIds)
    {
        return sysAccountsMapper.deleteSysAccountsByIds(accountsIds);
    }

    /**
     * 删除部门金额明细信息
     * 
     * @param accountsId 部门金额明细ID
     * @return 结果
     */
    @Override
    public int deleteSysAccountsById(Long accountsId)
    {
        return sysAccountsMapper.deleteSysAccountsById(accountsId);
    }

    @Override
    public List<SysAccounts> queryMoneyType(SysAccounts sysAccounts) {
        return sysAccountsMapper.queryMoneyType(sysAccounts);
    }
}
